package _4ChapterFore._3ConsolidateDuplicateConditionalFragments;

public class Main {

    int price = 100;
    int role = 1;
    public void fun1(){
        double total;
        if (isSpecialDeal()){
            total = price * 0.95;
            send();
        }else {
            total = price * 0.98;
            send();
        }
    }

    public void fun2(){
        double total;
        if (isSpecialDeal()){
            total = price * 0.95;
        }else {
            total = price * 0.98;
        }
        send();
    }

    public void send(){}

    public boolean isSpecialDeal(){
        return role==1;
    }
}
